import React, { Component } from 'react';
import { StyleSheet, Text, View, Image, TouchableOpacity, PixelRatio } from "react-native";
import { GLOBAL } from '../../../../../config/global';
import MethodUtil from '../../../../../utils/MethodUtil';
const scale = GLOBAL.SCALE;
//底部审批按钮
export class ApproveButtonNew extends Component {
	constructor(props) {
		super(props);
		this.state = {
		}
	}
	render () {
		const { agreePress, refusePress, data } = this.props;
		return (
			<View>
				{data ?
					<View style={styles.bottomBtnCell}>
						<View style={styles.bottomText}>
							<Text style={{ fontSize: 12, color: '#000' }}>共计{data.goodsCount}件,{data.goodsCountSum}吨,¥{MethodUtil.toThousands(data.priceSum || 0, 2)}元</Text>
							<Text style={{ fontSize: 12, color: '#E02020', marginTop: 5 }}>毛利 {MethodUtil.toThousands(data.orderGrossProfitCnt || 0, 2)} 元</Text>
						</View>
						<View style={styles.bottomBtnView}>
							<TouchableOpacity activeOpacity={0.5} style={[styles.bottomBtn, { marginRight: 12, backgroundColor: '#0E7FFD' }]}
								onPress={agreePress} >
								<View style={styles.bottomBtnView}>
									<Text style={[styles.bottomBtnText, { color: '#fff' }]}>通过</Text></View>
							</TouchableOpacity>
							<TouchableOpacity activeOpacity={0.5} style={styles.bottomBtn}
								onPress={refusePress} >
								<View style={[styles.bottomBtnView, styles.bottomBtnViewLeft]}>
									<Text style={[styles.bottomBtnText, { color: '#0E7FFD' }]}>驳回</Text></View>
							</TouchableOpacity>
						</View>
					</View>
					: null}
			</View>
		)
	}

}

const styles = StyleSheet.create({
	bottomBtnCell: {
		width: 375 * scale,
		height: 85 * scale,
		flexDirection: 'row',
		borderTopColor: '#e4e4e4',
		borderTopWidth: 1 / PixelRatio.get(),
		backgroundColor: '#fff',
	},
	bottomBtn: {
		justifyContent: 'center',
		borderColor: '#0E7FFD',
		borderWidth: 1,
		borderRadius: 6,
		paddingVertical: 5,
		paddingHorizontal: 21
	},
	bottomBtnPic: {
		marginRight: 20 * scale,
	},
	bottomBtnView: {
		flexDirection: 'row',
		justifyContent: 'center',
		alignItems: 'center',
	},
	bottomBtnViewLeft: {
		borderRightColor: '#e4e4e4',
		borderRightWidth: 1 / PixelRatio.get(),
	},
	bottomBtnText: {
		fontSize: 12 * scale,
	},
	bottomText: {
		marginTop: 30,
		marginHorizontal: 10,
		width: '50%',
	}
})